﻿@using Dotnet6.Web.DbEntitys
@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@model List<UserInfo>
@{
}

<div>
    用户信息表
    <h3> @Html.ActionLink("新增", "Edit", "user", new { }, new { @class = "btn btn-primary" })</h3>
    <table class="table table-bordered table-hover">
        <thead class="thead-light">
            <tr>
                <th scope="col">Id</th>
                <th scope="col">Name</th>
                <th scope="col">Account</th>
                <th scope="col">Password</th>
                <th scope="col">Age</th>
                <th scope="col">Phone</th>
                <th scope="col">CreateTime</th>
                <th scope="col">操作</th>
            </tr>
        </thead>
        @{
            //这里的 Model 就是 return view(users)  users，用的时候需要在上面 @model List<UserInfo> 指定类型
            foreach (UserInfo user in Model)
            {
                <tr>
                    <td scope="row">@user.Id</td>
                    <td>@user.Name</td>
                    <td>@user.Account</td>
                    <td>@user.Password</td>
                    <td>@user.Age</td>
                    <td>@user.Phone</td>
                    <td>@user.CreateTime</td>
                    <td>@Html.ActionLink("详情", "Edit", new { id = user.Id }) @Html.ActionLink("删除", "DeleteUser", new { id = user.Id })</td>
                </tr>
            }
        }
    </table>
</div>
